#ifndef GRAPHICSRECTITEM_H
#define GRAPHICSRECTITEM_H


#include <QGraphicsObject>

class GraphicsRectItem : public QGraphicsObject
{
    Q_OBJECT
    Q_PROPERTY(qreal rotation READ rotation WRITE setRotation)  // 支持旋转属性

public:
    explicit GraphicsRectItem(QGraphicsItem *parent = nullptr);
    QRectF boundingRect() const override;  // 实现纯虚函数
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;  // 实现纯虚函数

private:
    QRectF rect;  // 矩形区域
};

#endif // GRAPHICSRECTITEM_H
